<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel = "stylesheet" href = "bootstrap/css/bootstrap.css" />
<link rel = "stylesheet" href = "bootstrap/css/style.css" />
<script type = "text/javascript" src = "bootstrap/js/jquery-1.11.0.min.js"></script>
<script type = "text/javascript" src = "bootstrap/js/bootstrap.js"></script>
<title>Permissions Page</title>
</head>
<body>
	
	<div class = "myPermissions">
		<div class = "row">
			<div class = "col-lg-12">
				<div class = "panel panel-success">
				<div class = "panel-heading"> <h4>Roles_Permissions</h4></div>
					<div class = "panel-body">
						<center><img src = "bootstrap/images/logo_ibm.png" width = "90" height = "50"></center>
						<hr>
						<a type="button" class = "btn btn-primary" 
		                    href="http://localhost:9090/java-jsp-ashry/RolePermission.jsp">
		                    Add Role_Permission</a>
						<div class = "table-responsive" style = "margin-top:3%;">
						<table class = "table" border = "1">
							<tr><th>ID</th><th>Role_ID</th><th>Permission_ID</th><th colspan = "2">Options</th></tr>
							<c:forEach items="${roleperms}" var="perm">
		                    <tr><td><c:out value="${perm.id}" /></td><td><c:out value="${perm.roleid}" /></td><td><c:out value="${perm.perid}" />
		                    </td><td>
		                    <a type="button" class = "btn btn-info" 
		                    href="http://localhost:9090/java-jsp-ashry/editRolePermission.jsp?value=${perm.id}">
		                    Edit</a></td>
		                    <td>
		                    <a type="button" class = "btn btn-warning" 
		                    href="http://localhost:9090/java-jsp-ashry/DelRolePermission?value=${perm.id}">
		                    Delete</a></td>
		                    </tr>
 	                        </c:forEach>
						</table>
						<a 
		                    href="http://localhost:9090/java-jsp-ashry/ShowRole">
		                    Roles </a>
		                <a  
		                    href="http://localhost:9090/java-jsp-ashry/ShowPermissionsServlet">
		                    Premissions</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>